<template>
	<view class="container">
		<yiyi-parse v-if="newsInfo" :content="newsInfo.content" :lazy-load="true"></yiyi-parse>
	</view>
</template>

<script>
	import { getNewsInfo } from '@/api/sys/newsInfo';
	export default {
		data() {
			return {
				newsInfo: null,
			};
		},
		onLoad(option) {
			if (option.newsId) {
				this.getData(option.newsId);
			}
		},
		methods: {
			getData(newsId) {
				getNewsInfo(newsId).then(res => {
					this.newsInfo = res.result;
					uni.setNavigationBarTitle({
						title: this.newsInfo.title
					});
				});
			}
		}
	};
</script>

<style lang="scss">
	.container {
		width: 100%;
		padding: $uni-spacing-row-lg;
		box-sizing: border-box;
		padding-bottom: 48rpx;

		.tui-text {
			font-size: $uni-font-size-sm;
			text-indent: 2em;
			color: $uni-text-color;
			padding-bottom: $uni-spacing-col-sm;
			tui-text-align: justify;
		}

		.tui-sub {
			padding-left: $uni-spacing-row-sm;
		}
	}
</style>